#ifndef __C_GAME_SCENE_MANAGER_H_INCLUDED__
#define __C_GAME_SCENE_MANAGER_H_INCLUDED__
#include "IGameSceneManager.h"
#include "IDeviceManager.h"
#include "irrMap.h"
#include "irrString.h"

namespace game
{
    namespace scene
    {

		/*!
        The Game Scene Manager manages game objects, cameras objects , lights objects and all the other stuff.
        */
        class CGameSceneManager : public IGameSceneManager, IGameObject
        {
        public:
			//! Constructor
			CGameSceneManager(IDeviceManager* deviceManager);
			
			//! Destructor
			virtual ~CGameSceneManager();
			
			//! Gets current game scene
			virtual IGameScene* getCurrentGameScene();
			
			//! Sets current game scene
			virtual void setCurrentGameScene(IGameScene* value);

			virtual void registerGameSceneType(const c8* typeName, delegateGameSceneCreator* gameSceneCreator);

			virtual IGameScene* getGameScene(const c8* fileName);
		
			//! Gets dynamic object with specified type
			virtual IDynamicObject* getDynamicObject(const c8* fileName, EGAME_OBJECT_TYPE type);

			//! Load location object from xml file. If you want load world just use this func, but set type "world"
			virtual ILocationObject* getLocationObject(const c8* fileName);

			//! Gets scene manager
			virtual irr::scene::ISceneManager* getSceneManager();

			virtual video::IVideoHandler* getVideoHandler();
			
			//! Not worked in this class. 
			virtual void addToScene();

			//! Not worked in this class. 
			virtual void removeFromScene();

			//! Not worked in this class.
			virtual void setPosition(const irr::core::vector3df& value);

		protected:

			virtual bool onUserAction(SUserAction action);

			virtual bool onNetworkRequest(void* data);

			virtual void onChangeScene(EventArgs e);

		private:
			
			//! Represents the current game scene
			IGameScene* CurrentScene;

			//! Owner device 
			IDeviceManager* DeviceManager;
			
			//! Represents GameScenes creators
			irr::core::map<irr::core::stringc, delegateGameSceneCreator*>* Creators;


		};
	}


}
#endif
